Improved javascript regex regocnizing for extracting js messages#791
Improved javascript regex regocnizing for extracting js messages#791gitaarik wants to merge 3 commits intopython-babel:masterfrom
Conversation
|
Hi @akx, have you had time to look at this? It would be nice if this can be merged. |
akx
left a comment
There was a problem hiding this comment.
Beyond the other comments, I'd appreciate tests showing how this improves parsing for the files previously accepted :)
|
Hey @akx , could you please give me some guidance about how/where I should add unit tests for this? I haven't found clear documentation about this. |
c9baa67 to
be48522
Compare
be48522 to
fdcac82
Compare
|
@akx Got it now, I wasn't familiar with tox, but now I am, a little. I added the unit test: I would really appreciate it if this can be merged soon and that a new release could be made. Then the build process of our project can be greatly simplified :). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #791 +/- ##
=======================================
Coverage 89.82% 89.82%
=======================================
Files 25 25
Lines 4391 4391
=======================================
Hits 3944 3944
Misses 447 447 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I'm not completely understanding this Codecov result, and what, if anything, is wrong. |
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1444 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 X-original-commit: df307ed
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1461 X-original-commit: df307ed Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1462 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 X-original-commit: d711ad2
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 X-original-commit: d711ad2
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 X-original-commit: d711ad2
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1465 X-original-commit: d711ad2 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1464 X-original-commit: d711ad2 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1463 X-original-commit: d711ad2 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
|
@akx Is what you requested done now? can this be merged? |
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes odoo/o-spreadsheet#1461 X-original-commit: df307ed6a0e79370a8405b902df1e909671fb035 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes odoo/o-spreadsheet#1464 X-original-commit: d711ad2cb1ef220d8a02853243859a4572748d61 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes odoo/o-spreadsheet#1463 X-original-commit: d711ad2cb1ef220d8a02853243859a4572748d61 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
In a JS library that I use, there was regex with a
/inside a character class[a-z]. The babel JS lexer thought this closed the regex, but JavaScript allows this as a normal match character within a character class, and does not close the regex. I updated the regex so that it will cover this exception.This could also possibly fix these issues, or set the stage for further improvements regarding these issues:
How do I add unit tests for this? I haven't found clear documentation about this.